package priv.dajie.tzzq.bot.model;

import java.math.BigDecimal;
import java.util.Date;

public class SellHistoryItem {
    private String steamName;
    private String tradeID;
    private BigDecimal price;
    private Date date;
    private TradeState tradeState;

    public SellHistoryItem(String steamName, String tradeID, BigDecimal price, TradeState tradeState) {
        this.steamName = steamName;
        this.tradeID = tradeID;
        this.price = price;
        this.tradeState = tradeState;
    }

    public SellHistoryItem(String steamName, String tradeID, BigDecimal price, Date date, TradeState tradeState) {
        this.steamName = steamName;
        this.tradeID = tradeID;
        this.price = price;
        this.date = date;
        this.tradeState = tradeState;
    }

    public String getSteamName() {
        return steamName;
    }

    public String getTradeID() {
        return tradeID;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public TradeState getTradeState() {
        return tradeState;
    }

    public Date getDate() {
        return date;
    }

    @Override
    public String toString() {
        return "SellHistoryItem{" +
                "steamName='" + steamName + '\'' +
                ", tradeID='" + tradeID + '\'' +
                ", price=" + price +
                ", date=" + date +
                ", tradeState=" + tradeState +
                '}';
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof SellHistoryItem){
            SellHistoryItem sellHistoryItem = (SellHistoryItem)obj;
            return sellHistoryItem.price.equals(this.price) && sellHistoryItem.steamName.equals(this.steamName) && sellHistoryItem.tradeID.equals(tradeID);
        }
        return false;
    }
}
